package File;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;

public class Demo16 {
    public static void main(String[] args) {
        try(InputStream inputStream=new FileInputStream("./test.txt")){
            while(true){
                byte[] data=new byte[3];
               int n= inputStream.read(data);
               if(n==-1)break;
                for (int i = 0; i <data.length ; i++) {
                    System.out.printf("%x",data[i]);
                }
            }
        } catch (IOException e) {
            throw new RuntimeException(e);
        }


    }
}
